<h2 class="contentTitle">套餐</h2>
<div class="pageContent">
    <!-- 	      <form id="myform" action="{:U('Money/cmoneyauth')}" method="post"  onsubmit="return validateCallback(this,dialogAjaxDone);"> --><!--       	<table cellpadding=0 cellspacing=0 class="table_form" width="100%"> --><!--   		<tr> --><!-- 			<td>增加预付款：</td> --><!-- 			<td><input type="text" class="input-text"  name="amount" value="0" >填写负数为减少</td> --><!-- 		</tr> --><!--         <tr> --><!-- 			<td>增加赠送帐户：</td> --><!-- 			<td><input type="text" class="input-text"  name="give" value="0" >填写负数为减少</td> --><!-- 		</tr> --><!-- 		</table> --><!-- 		<div class="btn"> --><!-- 		<input type="hidden" name="id" value="{$vo['id']}" /> --><!-- 		<input type="hidden" name="forward" value="{$_SERVER['HTTP_REFERER']}" /> --><!-- 		<INPUT TYPE="submit"  value="{:L('提交')}" class="button" > --><!-- 		<input TYPE="reset"  value="{:L('取消')}" class="button"> --><!-- 		</div> --><!--       </form> -->
    <form id="myform" action="{:U('Sales/package_save')}" method="post" onsubmit="return validateCallback(this,dialogAjaxDone);">
        <input type="hidden" name="data[product_ids]" value="{$proid}" /><input type='hidden' name='data[id]' value='{$package.id}' />
        <div class="pageFormContent nowrap" layoutH="97">
            {if $product}
			  <fieldset>
                <legend>
                    商品信息
                </legend>
                <dl>
                    <dt>
                        商品名称：
                    </dt>
                    <dd>
                        <a title='查看'  target="dialog" width="880" height="650" rel='jupro_{$proid}'  href="{:U('Content/show',array('id'=>$proid))}">{$product.base.name}</a>
                    </dd>
                </dl>
                <dl>
                    <dt>
                    </dt>
                    <dd>
                    	{if $product['base']['image']}
                        <a title='查看'  target="dialog" width="880" height="650" rel='jupro_{$proid}'  href="{:U('Content/show',array('id'=>$proid))}">
                        	<img width="150" height="130" src="{$product['base']['image']|addrimage}"></a>
                   		{/if}
				    </dd>
                </dl>
                <dl>
                    <dt>
                        分销商价：
                    </dt>
                    <dd>
                        {$product['price']['jiasi']}CV
                    </dd>
                </dl>
                <dl>
                    <dt>
                        市级连锁：
                    </dt>
                    <dd>
                        {$product['price']['jiasan']}CV
                    </dd>
                </dl>
                <dl>
                    <dt>
                        省级连锁：
                    </dt>
                    <dd>
                        {$product['price']['jiaer']}CV
                    </dd>
                </dl>
                <dl>
                    <dt>
                        全国连锁：
                    </dt>
                    <dd>
                        {$product['price']['jiayi']}CV
                    </dd>
                </dl>
            </fieldset>
			{/if}
			
			<dl>
                <dt>
                    套餐标题：
                </dt>
                <dd>
                    <input type="text" style="float: none;" class="required autoinput" alt="标题" name="data[title]" style='width:300px;' value="{$package.title}" data-validate="validate(required);">
                </dd>
            </dl>
            <dl>
                <dt>
                    套餐类型：
                </dt>
                <dd>
                    <input type="radio" class="input-text" name="data[type]" value="BIG" checked='checked'>大宗批发
                    {if $type != 'BIG' }<input type="radio" class="input-text" name="data[type]" value="SERIES">组合套餐
                    {/if}
                </dd>
            </dl>
            <dl>
                <dt>
                    套餐数量：
                </dt>
                <dd>
                    <input type="text" class="required autoinput" alt="数量" name="data[prerequ]" value="{$package.prerequ}" style="float: none;" data-validate="validate(required,digits);">
                </dd>
            </dl>
            <dl>
                <dt>
                    套餐价格：
                </dt>
                <dd>
                    <input type="text" class="required autoinput" alt="价格" name="data[all_special_price]" value="{$package['all_special_price']/100}" style="float: none;" data-validate="validate(required,digits);">CV
                </dd>
            </dl>
            <dl>
                <dt>
                    开始时间：
                </dt>
                <dd>
                    <div class="unit">
                        <input type="text" name="data[start_time]" value="{if $package['start_time']}{$package.start_time|date='Y-m-d H:i:s',###}{/if}" class="date" dateFmt="yyyy-MM-dd HH:mm:ss" readonly="true" placeholder="不填写为不限制"/><a class="inputDateButton" href="javascript:;" >选择</a>
                        <!--<span class="info">不填写为不限制</span>-->
                    </div>
                </dd>
            </dl>
            <dl>
                <dt>
                    结束时间：
                </dt>
                <dd>
                    <div class="unit">
                        <input type="text" name="data[end_time]" value="{if $package['end_time']}{$package.end_time|date='Y-m-d H:i:s',###}{/if}" class="date" dateFmt="yyyy-MM-dd HH:mm:ss" readonly="true" placeholder="不填写为不限制" /><a class="inputDateButton" href="javascript:;">选择</a>
                        <!--<span class="info">不填写为不限制</span>-->
                    </div>
                </dd>
            </dl>
        </div>
        <div class="formBar">
            <ul>
                <li>
                    <div class="buttonActive">
                        <div class="buttonContent">
                            <button type="submit">
                                保存
                            </button>
                        </div>
                    </div>
                </li>
                <li>
                    <div class="button">
                        <div class="buttonContent">
                            <button type="button" class="close">
                                取消
                            </button>
                        </div>
                    </div>
                </li>
            </ul>
        </div>
    </form>
</div>

<script>
    $(function(){
        $.ketchup.createErrorContainer(function(form, el) {
            return $('<ul/>', {
                    'class': 'ketchup-custom'
                    }).insertAfter(el);
        }).addErrorMessages(function(form, el, container, messages) {
            container.html('');

            for(i = 0; i < messages.length; i++) {
            $('<li/>', {
                text: messages[i]
            }).appendTo(container);
            }
        }).showErrorContainer(function(form, el, container) {
            container.slideDown('fast');
        }).hideErrorContainer(function(form, el, container) {
            container.slideUp('fast');
        });

        $('#myform').ketchup({
            validateEvents: 'blur keyup'
        });    
    })
</script>